// Purpose: Make Correction and further cleaning for HEAD TEACHER 
// Created on: 20 July 2016
// Lastly modified: 9 Sept 2016

clear all
set more off 
cap log close 

*global raw_dir "X:\Box.net\IPA_RWA_Project_Educate\07_Questionnaires&Data\Baseline_Quantitative\03_DataManagement\04 Data\Encrypted data\Final Data\Raw_Data\HeadTeacher"
global raw_dir "[directory]/HeadTeacher"

*global clean_dir "X:\Box.net\IPA_RWA_Project_Educate\07_Questionnaires&Data\Baseline_Quantitative\03_DataManagement\04 Data\Encrypted data\Final Data\Cleaned_Data"
global clean_dir "[directory]/HTeacher"

cd "$raw_dir"

use "Master_HeadTeacher - Copy",clear

*The code -88 means "Refused to answer"

*DMAST schools

drop if school==145
drop if school==60

drop subscriberid	simid	devicephonenum uniqueid

// 1. SCHOOL IDENTIFICATION 

/*	*102-103
foreach var in cell village{
replace `var'=. if `var'==192
}
	
*/
	*101
drop district_str
	
    *103

label  define celllab 192 "XXXX", modify // removed for respondent privacy
lab val cell celllab

label define villagelab 198 "XXXX", modify // removed for respondent privacy
lab val village villagelab

    *105
replace distrloc_106=1 if key=="uuid:d5a593a8-1fa2-4399-91c6-d6f104b1d0bb"
replace distrloc_106=1 if key=="uuid:a05de6f8-9028-43df-82ae-98394034992c"



	*107
tostring school_code_107, replace
gen myid="0"+school_code_107
drop school_code_107
rename myid school_code_107
order school_code_107, after(school)


     *110 Group
replace group_110=2 if key=="uuid:1206c78f-0bef-47e1-86f5-5d10caa0ae22"
replace group_110=2 if key=="uuid:f459fb90-0b7e-4365-a266-29e336a6bb95"

*The following schools are in Group 2 Control 
   
replace group_110=2 if key=="uuid:0c430327-927b-4e60-a4ea-418cd662508e"

replace group_110=2 if key=="uuid:f1aa53bf-43f6-4572-bdd3-b773203caee2"
    
replace group_110=2 if key=="uuid:d5e89bb5-5a20-4aa9-92c5-6c07c48edf1c"

replace group_110=2 if key=="uuid:c954197a-d660-4cb4-85b3-80308b6846d1"
    
replace group_110=2 if key=="uuid:d0feda91-9ee7-421f-982a-160e3b241ba3"

replace group_110=2 if key=="uuid:84365de1-c2d8-427c-a528-e49e37febffa"

replace group_110=2 if key=="uuid:d26b8745-e313-49df-8626-47a58eaff925"    
   
replace group_110=2 if key=="uuid:27950b4c-7a91-415b-b8ef-0c63e0df90e1"

replace group_110=2 if key=="uuid:141d1d90-bdff-4660-ae20-34c29c442829"
   
replace group_110=2 if key=="uuid:1bdb5a05-2777-4cab-a059-f26fbd6e0ea7"

replace group_110=2 if key=="uuid:2b6b65f9-2cd9-49aa-b64b-9986f784f395"
       

*The following schools are in Group 1 Treatment  
replace group_110=1 if key=="uuid:f1e536f6-9927-4ca4-a379-b12e1efc459c"
 
replace group_110=1 if key=="uuid:092e0bec-240e-4f6c-b870-02f1d2d40ee6"

     *114
/*
replace visit_date_114=07032016 if key=="uuid:53cf98da-b56b-4b41-af34-66be7a601256"
replace visit_date_114=09032016 if key=="uuid:beacf8c2-a350-48f2-8caa-d1cdf2072f27"
replace visit_date_114=26022016 if key=="uuid:c2feca3b-783e-4d4c-b067-e66f48b34b31"
replace visit_date_114=01032016 if key=="uuid:84365de1-c2d8-427c-a528-e49e37febffa"

replace sch_year_115=01011933 if key=="uuid:0cc69619-c327-4ca8-a34d-ef0554bef175"
*/
     *115
order sch_year_115, after(know_date_115)
format sch_year_115 %td
replace sch_year_115=mdy(12,31,1927) if school_code_107=="0403132"
replace sch_year_115=mdy(12,31,1928) if school_code_107=="0506118"
replace sch_year_115=mdy(12,31,1927) if school_code_107=="0506109"
replace sch_year_115=mdy(12,31,1930) if school_code_107=="0503114"
replace sch_year_115=mdy(12,31,1933) if school_code_107=="0301128"
replace sch_year_115=mdy(12,31,1934) if school_code_107=="0301123"
replace sch_year_115=mdy(12,31,1933) if school_code_107=="0301126"
replace sch_year_115=mdy(12,31,1935) if school_code_107=="0301117"
replace sch_year_115=mdy(12,31,1927) if school_code_107=="0305135"
replace sch_year_115=mdy(12,31,1927) if school_code_107=="0305143"
replace sch_year_115=mdy(12,31,1933) if school_code_107=="03503001"
replace sch_year_115=mdy(12,31,1933) if school_code_107=="0403112"
replace sch_year_115=mdy(12,31,1917) if school_code_107=="0403122" 
replace sch_year_115=mdy(12,31,1934) if school_code_107=="0304107"

replace sch_year_115=mdy(1,1,1933) if key=="uuid:0cc69619-c327-4ca8-a34d-ef0554bef175"
replace sch_year_115=mdy(1,1,1927) if key=="uuid:413bdd73-047b-4797-a099-ba725246da01"
replace know_date_115=0 if key=="uuid:5f20625d-7c89-4016-82bd-b796a3368da2"
replace know_date_115=0 if key=="uuid:d9da1c76-ddf9-4cd6-9f55-9f3503e3b32b"
replace know_date_115=0 if key=="uuid:14fc9ec1-a732-4331-8d07-513b151e218a"
replace sch_year_115=. if key=="uuid:5f20625d-7c89-4016-82bd-b796a3368da2"
replace sch_year_115=. if key=="uuid:d9da1c76-ddf9-4cd6-9f55-9f3503e3b32b"
replace sch_year_115=. if key=="uuid:14fc9ec1-a732-4331-8d07-513b151e218a"

gen year_115=year(sch_year_115)
order year_115, before(sch_year_115)
lab var year_115 "115_Year this school was created/built?"

*br sch_year_115 if key=="uuid:0cc69619-c327-4ca8-a34d-ef0554bef175"
replace year_115=1933 if key=="uuid:0cc69619-c327-4ca8-a34d-ef0554bef175"
replace year_115=-99 if key=="uuid:5f20625d-7c89-4016-82bd-b796a3368da2"
replace year_115=-99 if key=="uuid:d9da1c76-ddf9-4cd6-9f55-9f3503e3b32b"
replace year_115=-99 if key=="uuid:14fc9ec1-a732-4331-8d07-513b151e218a"
replace year_115=. if year_115==-99


     *117
replace buildcond_117="-66" if buildcond_117=="Other(specify)"|buildcond_117=="other"

destring buildcond_117, replace
#delimit ;
label define buildcond_117lab
1 "Building in good condition" 
2 "Building needs some minor repairs" 
3 "Building needs rehabilitation" 
4 "No roof, walls are heavily damaged, need complete reconstruction" 
5 "Needs complete reconstruction" 
-66 "Other(specify)";
#delimit cr
lab val buildcond_117 buildcond_117lab

*lab def schoolcond 1 "Building in good condition" 2 "Building needs some minor repairs" 3 "Building needs rehabilitation" 4 "No roof, walls are heavily damaged, need complete reconstruction" 5 "Needs complete reconstruction" -66 "Other(specify)" 
*lab val buildcond_117 schoolcond



// 2. HEAD TEACHER IDENTIFICATION 
	
	*201
replace pos_201="-66" if pos_201=="other"
destring pos_201, replace
#delimit ;
label define pos_201lab
1 "Head Teacher" 
2 "Deputy Head Teacher" 
3 "Teacher Representative" 
4 "Normal Teacher" 
-66 "Other(specify)";
 #delimit cr
 
lab val pos_201 pos_201lab

	*203
replace age_203=. if age_203==-55

	*204
*Here, -33 meant "Less than 1 year"
*Keep drop specify_less1yr_204 so that the number of months or days remain.
* Years _204 
replace years_ht_exp_204=-99 if school_code_107=="301037"

replace specify_less1yr_204="4 moths" if key=="uuid:95ab5139-4dd8-4ffb-af71-f805c611f105"
replace years_ht_exp_204=4/12 if specify_less1yr_204=="4 moths"
	
replace years_ht_exp_204=1/12 if specify_less1yr_204=="One month"
replace years_ht_exp_204=1/52 if specify_less1yr_204=="7days"|specify_less1yr_204=="1week"
replace years_ht_exp_204=7/12 if specify_less1yr_204=="7 moths"
replace years_ht_exp_204=6/12 if specify_less1yr_204=="6months"
replace years_ht_exp_204=38/365 if specify_less1yr_204=="38 days"
replace years_ht_exp_204=37/365 if specify_less1yr_204=="37 days"
replace years_ht_exp_204=24/365 if specify_less1yr_204=="24 days"
replace years_ht_exp_204=21/365 if specify_less1yr_204=="21"
replace years_ht_exp_204=2/12 if inlist(specify_less1yr_204, "2 mouth", "2 mouth", "2 months")
replace years_ht_exp_204=1/12 if inlist(specify_less1yr_204, "1months", "1month","1 Month", "1 month")
replace years_ht_exp_204=10/12 if specify_less1yr_204=="10months"
replace years_ht_exp_204=. if years_ht_exp_204==-99|years_ht_exp_204==-55

replace specify_less1yr_204="" if specify_less1yr_204=="-55"
replace specify_less1yr_204="" if specify_less1yr_204=="-99"

	*205
replace years_teach_exp_205=. if years_teach_exp_205==-99
drop specify_less1yr_205

	*206
	
	
	*209
replace p_appl_na=-77 if p_appl_na==-99
replace p_appl_na=-77 if key=="uuid:d9da1c76-ddf9-4cd6-9f55-9f3503e3b32b"
replace p_stud_t=1939 if p_stud_t==1931
replace s4_stud_t=57 if s4_stud_t==52
replace p_stud_t=1017 if p_stud_t==1011

replace p_appl_na=-99 if p_appl_na==-55
replace s1_appl_na=-77 if s1_appl_na==-55
replace s2_appl_na=-77 if s2_appl_na==-55
replace s3_appl_na=-77 if s3_appl_na==-55
replace s4_appl_na=-77 if s4_appl_na==-55
replace s5_appl_na=-77 if s5_appl_na==-55
replace s6_appl_na=-77 if s6_appl_na==-55

replace p_stud_m=. if p_stud_m==-55
replace p_stud_m=. if p_stud_m==-99
replace p_stud_f=. if p_stud_f==-55
replace p_stud_f=. if p_stud_f==-99

replace s1_stud_m=. if s1_stud_m==-55
replace s2_stud_m=. if s2_stud_m==-55
replace s3_stud_m=. if s3_stud_m==-55
replace s4_stud_m=. if s4_stud_m==-55
replace s5_stud_m=. if s5_stud_m==-55
replace s6_stud_m=. if s6_stud_m==-55


	*210
replace primary_appl_na=-77 if primary_appl_na==-55
replace lower_s_appl_na=-77 if lower_s_appl_na==-55
replace p_teach_m=. if p_teach_m==-99
replace p_teach_f=. if p_teach_f==-99
replace lower_s_teach_m=. if lower_s_teach_m==-55
replace lower_s_teach_f=. if lower_s_teach_f==-55
replace numteachers=1 if numteachers==0

foreach k in s2_stud_t s4_stud_f p_stud_m p_stud_f p_stud_t s1_stud_m s1_stud_f s1_stud_t s2_stud_m s2_stud_f s3_stud_m s3_stud_f s3_stud_t s4_stud_m s4_stud_t s5_stud_m s5_stud_f s5_stud_t s6_stud_m s6_stud_f s6_stud_t{
rename `k' `k'_209
}
foreach v in p_teach_m p_teach_f lower_s_teach_m lower_s_teach_f upper_s_teach_m upper_s_teach_f{
rename `v' `v'_210
}

drop p_appl_na-s6_appl_na
drop primary_appl_na lower_s_appl_na upper_s_appl_na

*Look closely and adjust all number from 209 and 210 - Check the internal consistency of both tables

	*211
        *Options for Teacher 1
replace name_211_1="Sande Theoneste" if key=="uuid:50b1f853-92f6-426a-8fcf-f16a89254151"
replace gender_211_1=1 if key=="uuid:50b1f853-92f6-426a-8fcf-f16a89254151"
replace lev_taught_211_1="1 2 3 4 5 6" if key=="uuid:50b1f853-92f6-426a-8fcf-f16a89254151"
replace opt_2111="" if opt_2111=="-55"
replace opt_2111="" if opt_2111=="- 55"
replace opt_2111="" if opt_2111=="-56"
replace opt_2111="" if opt_2111=="-77"
replace opt_2111="" if opt_2111=="- 77"
replace opt_2111="" if opt_2111=="12"
replace opt_2111="" if opt_2111=="5"
replace opt_2111="" if opt_2111=="- 66"
replace opt_2111="" if key=="uuid:3fd7cad9-5ce2-4f19-b141-8da2b1760832"
replace opt_2111="HEG, LFK, MPG" if key=="uuid:14f0cf85-4b98-49c3-8829-36ad22d13f6f"
replace opt_2111=" MCB,LFK, HEG" if key=="uuid:42979c82-445b-4979-bf5f-704c5a9856a7"
replace opt_2111="HEG, LFK" if key=="uuid:f763a8a6-4d5d-46ef-a196-e44f4112b858"
replace opt_2111="MCB,HEG,LFK" if key=="uuid:f88bc270-5ff0-4c2c-a4e6-26c84c69e8fe"
replace opt_2111="LFK, MPG, HEG" if opt_2111=="EFK, MPG,HEG"
replace opt_2111="MPG, MEG, LFK" if key=="uuid:ee43c1f3-0873-4b46-ae6a-61cea388cda1"
replace opt_2111="LKK, MCE" if opt_2111=="EKK,MEC"
replace opt_2111="MEG, LFK" if key=="uuid:f1e536f6-9927-4ca4-a379-b12e1efc459c"
replace opt_2111="HEG, MPG, LKK" if opt_2111=="HEG, MPG, EKK"
replace opt_2111="LKK, LFK" if opt_2111=="LKK, EFK"
replace opt_2111="LKK" if opt_2111=="Lkk"
replace opt_2111="MCB,LFK" if opt_2111=="MCB,EFK"
replace opt_2111="MEG, PCB, MCB" if opt_2111=="MEG, PCB, MBC"
replace opt_2111="PCB,HEG,LFK" if opt_2111=="PCB,heg,lfk"
replace opt_2111="PCM,HEG,LFK" if opt_2111=="PCM,HEG,EFK"
replace opt_2111="PCM,LKK,HEL" if opt_2111=="PCM,lkk,hel"
replace opt_2111="" if opt_2111=="_55"
         
		* subjects fir teacher 1
split oth_subj_211_1, parse ("")
order oth_subj_211_11 oth_subj_211_12 oth_subj_211_13, after(oth_subj_211_1)
replace oth_subj_211_11="-66" if oth_subj_211_11=="other"
replace oth_subj_211_11="" if oth_subj_211_11=="-55"
replace oth_subj_211_11="" if oth_subj_211_11=="-77"

destring oth_subj_211_11, replace 
#delimit ;
label define oth_subj_211_11lab
1 "Physics"
2 "Chemistry"
3 "Maths"
4 "Biology"
5 "Geography"
6 "Economics"
7 "Histry"
8 "English"
9 "French"
10 "Kinyarwanda"
11 "Kiswahili"
12 "Computer Science"
13 "Literature"
-66 "Other(specify)";
#delimit cr

label val oth_subj_211_11 oth_subj_211_11lab

lab var oth_subj_211_11 "211_1_Which other subjects does the teacher [name] teach?"
lab var oth_subj_211_12 "211_1_Which other subjects does the teacher [name] teach?"
lab var oth_subj_211_13 "211_1_Which other subjects does the teacher [name] teach?"

lab var oth_subj_211_2 "211_2_Which other subjects does the teacher [name] teach?"
lab var oth_subj_211_3 "211_2_Which other subjects does the teacher [name] teach?"




replace oth_subj_211_12="-66" if oth_subj_211_12=="other"
destring oth_subj_211_12, replace 
#delimit ;
label define oth_subj_211_12lab
1 "Physics"
2 "Chemistry"
3 "Maths"
4 "Biology"
5 "Geography"
6 "Economics"
7 "History"
8 "English"
9 "French"
10 "Kinyarwanda"
11 "Kiswahili"
12 "Computer Science"
13 "Literature"
-66 "Other(specify)";
#delimit cr

label val oth_subj_211_12 oth_subj_211_12lab

replace oth_subj_211_13="-66" if oth_subj_211_13=="other"
destring oth_subj_211_13, replace 
#delimit ;
label define oth_subj_211_13lab
1 "Physics"
2 "Chemistry"
3 "Maths"
4 "Biology"
5 "Geography"
6 "Economics"
7 "History"
8 "English"
9 "French"
10 "Kinyarwanda"
11 "Kiswahili"
12 "Computer Science"
13 "Literature"
-66 "Other(specify)";
#delimit cr

label val oth_subj_211_13 oth_subj_211_13lab

replace teach_qual_211_1=. if teach_qual_211_1==-55
replace full_part_time_211_1=. if full_part_time_211_1==-55
replace lev_taught_211_2="" if lev_taught_211_2=="-55" 

drop oth_subj_211_1

  *Options for Teacher 2
replace opt_2112="" if opt_2112=="-55"
replace opt_2112="" if opt_2112=="- 55"
replace opt_2112="" if opt_2112=="-77"
replace opt_2112="" if opt_2112=="- 77"
replace opt_2112="" if opt_2112=="0"
replace opt_2112="" if opt_2112=="6"
replace opt_2112="" if opt_2112=="6,12"
replace oth_subj_211_2="5 7" if opt_2112=="7"
replace oth_subj_211_2="5 other" if opt_2112=="Ict"
replace oth_subj_211__other2="ICT" if oth_subj_211_2=="5 other"
replace opt_2112="" if opt_2112=="7"
replace opt_2112="" if opt_2112=="Ict"
replace opt_2112="" if opt_2112=="Entrepreneurship"
replace oth_subj_211_2="6 other" if opt_2112=="Religion"
replace opt_2112="" if key=="uuid:60c59bdf-58c5-47d1-b031-9f4d103466b1"
replace oth_subj_211__other2="Religion" if key=="uuid:60c59bdf-58c5-47d1-b031-9f4d103466b1"

replace opt_2112="MCB, LFK, HEG" if opt_2112=="MCB, EFK, HEG"
replace opt_2112="HEG,MCB,LFK" if opt_2112=="HEG,MCB,EFK"
replace opt_2112="HEL,LKK,PCM" if opt_2112=="He'll,lkk,pcm"
replace opt_2112="LEG ,LFK" if opt_2112=="!eg ,lfk"
replace opt_2112="HEG,LFK" if opt_2112=="Heg,lfk"
replace opt_2112="LFK,MPG,HEG" if opt_2112=="EFK,MPG,HEG"
replace opt_2112="MCB,LFK" if opt_2112=="MCB,EFK"
replace opt_2112="MCB" if opt_2112=="Mcb"
replace opt_2112="MPG, LEG, LFK" if key=="uuid:ee43c1f3-0873-4b46-ae6a-61cea388cda1"
replace opt_2112="LFK, PCM" if key=="uuid:3296f1ba-ad8c-4e8c-a98b-10ee54d5adc0"
replace opt_2112="MEG, LFK" if key=="uuid:f1e536f6-9927-4ca4-a379-b12e1efc459c"
replace opt_2112="LEG, LFK" if key=="uuid:37f8ac1a-4fcc-46af-8c20-4fa43ffb6a1f"

split oth_subj_211_2, parse ("")
order oth_subj_211_21 oth_subj_211_22 oth_subj_211_23, after( oth_subj_211_2 )
drop oth_subj_211_2

replace oth_subj_211_21="-66" if oth_subj_211_21=="other"
destring oth_subj_211_21, replace 
#delimit ;
label define oth_subj_211_21lab
1 "Physics"
2 "Chemistry"
3 "Maths"
4 "Biology"
5 "Geography"
6 "Economics"
7 "History"
8 "English"
9 "French"
10 "Kinyarwanda"
11 "Kiswahili"
12 "Computer Science"
13 "Literature"
-66 "Other(specify)";
#delimit cr

label val oth_subj_211_21 oth_subj_211_21lab
lab var oth_subj_211_21 "211_2_Which other subjects does the teacher [name] teach?"

replace oth_subj_211_21=. if oth_subj_211_21==-55
replace oth_subj_211_21=. if oth_subj_211_21==-77

replace oth_subj_211_22="-66" if oth_subj_211_22=="other"
destring oth_subj_211_22, replace 
#delimit ;
label define oth_subj_211_22lab
1 "Physics"
2 "Chemistry"
3 "Maths"
4 "Biology"
5 "Geography"
6 "Economics"
7 "History"
8 "English"
9 "French"
10 "Kinyarwanda"
11 "Kiswahili"
12 "Computer Science"
13 "Literature"
-66 "Other(specify)";
#delimit cr

label val oth_subj_211_22 oth_subj_211_22lab

destring oth_subj_211_23, replace 
#delimit ;
label define oth_subj_211_23lab
1 "Physics"
2 "Chemistry"
3 "Maths"
4 "Biology"
5 "Geography"
6 "Economics"
7 "History"
8 "English"
9 "French"
10 "Kinyarwanda"
11 "Kiswahili"
12 "Computer Science"
13 "Literature"
-66 "Other(specify)";
#delimit cr

label val oth_subj_211_23 oth_subj_211_23lab
replace full_part_time_211_2=. if full_part_time_211_2==-55

         *Options for Teacher 3
replace opt_2113="" if opt_2113=="-55"
replace opt_2113="" if opt_2113=="-5"
replace opt_2113="" if opt_2113=="-77"
replace opt_2113="" if opt_2113=="- 55"
replace opt_2113="" if opt_2113=="- 66"
replace opt_2113="" if opt_2113=="-66"
replace opt_2113="" if opt_2113=="12"
replace opt_2113="" if opt_2113=="6"
replace opt_2113="" if opt_2113=="Entrepreneurship"

replace opt_2113="HEG, MPG, LFK" if key=="uuid:14f0cf85-4b98-49c3-8829-36ad22d13f6f"
replace opt_2113="MCB, LFK, HEG" if key=="uuid:42979c82-445b-4979-bf5f-704c5a9856a7"
replace opt_2113="LFK" if opt_2113=="EFK"
replace opt_2113="HEG, LKK" if key=="uuid:95b6b881-7b1e-41b7-adc2-4212a0abc0af"
replace opt_2113="HEG,MCB,LFK" if key=="uuid:8bac3028-a4cf-4513-a73b-679d28c9b138"
replace opt_2113="LKK ,HEL,PCM" if key=="uuid:7907ad2d-33fb-409e-802c-abbd536e1817"
replace opt_2113="LKK,HEG" if opt_2113=="Lkk,HEG"
replace opt_2113="PCB" if key=="uuid:fc9acd77-9e01-49da-973a-077cf8708ba1"
replace opt_2113="PCM, HEG, LFK" if key=="uuid:f88bc270-5ff0-4c2c-a4e6-26c84c69e8fe"
replace opt_2113="LKK,HEG,MCB" if key=="uuid:96bb744c-f96b-4a5b-9d69-5c3358076331"
replace opt_2113="PCM, EFK, HEG" if key=="uuid:3296f1ba-ad8c-4e8c-a98b-10ee54d5adc0"

split oth_subj_211_3, parse ("")

drop oth_subj_211_3

replace oth_subj_211_31="-66" if oth_subj_211_31=="other"
destring oth_subj_211_31, replace 
#delimit ;
label define oth_subj_211_31lab
1 "Physics"
2 "Chemistry"
3 "Maths"
4 "Biology"
5 "Geography"
6 "Economics"
7 "History"
8 "English"
9 "French"
10 "Kinyarwanda"
11 "Kiswahili"
12 "Computer Science"
13 "Literature"
-66 "Other(specify)";
#delimit cr

label val oth_subj_211_31 oth_subj_211_31lab
lab var oth_subj_211_31 "211_3_Which other subjects does the teacher [name] teach?"

replace oth_subj_211_31=. if oth_subj_211_31==-55
replace oth_subj_211_31=. if oth_subj_211_31==-77

replace oth_subj_211_32="-66" if oth_subj_211_32=="other"
destring oth_subj_211_32, replace 
#delimit ;
label define oth_subj_211_32lab
1 "Physics"
2 "Chemistry"
3 "Maths"
4 "Biology"
5 "Geography"
6 "Economics"
7 "History"
8 "English"
9 "French"
10 "Kinyarwanda"
11 "Kiswahili"
12 "Computer Science"
13 "Literature"
-66 "Other(specify)";
#delimit cr

label val oth_subj_211_32 oth_subj_211_32lab

destring oth_subj_211_33, replace 
#delimit ;
label define oth_subj_211_33lab
1 "Physics"
2 "Chemistry"
3 "Maths"
4 "Biology"
5 "Geography"
6 "Economics"
7 "History"
8 "English"
9 "French"
10 "Kinyarwanda"
11 "Kiswahili"
12 "Computer Science"
13 "Literature"
-66 "Other(specify)";
#delimit cr

label val oth_subj_211_33 oth_subj_211_33lab

destring oth_subj_211_34, replace 
#delimit ;
label define oth_subj_211_34lab
1 "Physics"
2 "Chemistry"
3 "Maths"
4 "Biology"
5 "Geography"
6 "Economics"
7 "History"
8 "English"
9 "French"
10 "Kinyarwanda"
11 "Kiswahili"
12 "Computer Science"
13 "Literature"
-66 "Other(specify)";
#delimit cr

label val oth_subj_211_34 oth_subj_211_34lab
replace full_part_time_211_3=. if full_part_time_211_3==-55

order oth_subj_211_31 oth_subj_211_32 oth_subj_211_33 oth_subj_211_34, after (opt_2113)


    *Options for teacher 4
replace  opt_2114="" if  opt_2114=="-55"
replace  opt_2114="" if  opt_2114=="-77" 
replace  opt_2114="" if  opt_2114=="- 77"
replace  opt_2114="" if  opt_2114=="5,7"

replace oth_subj_211_4="6" if opt_2114=="6"
replace opt_2114="" if opt_2114=="6"

split oth_subj_211_4, parse ("")
order oth_subj_211_41 oth_subj_211_42, after(oth_subj_211_4)
drop oth_subj_211_4

replace oth_subj_211_41="-66" if oth_subj_211_41=="other"
replace oth_subj_211_41="" if oth_subj_211_41=="-77"
replace oth_subj_211_41="" if oth_subj_211_41=="-55"

destring oth_subj_211_41, replace 
#delimit ;
label define oth_subj_211_41lab
1 "Physics"
2 "Chemistry"
3 "Maths"
4 "Biology"
5 "Geography"
6 "Economics"
7 "History"
8 "English"
9 "French"
10 "Kinyarwanda"
11 "Kiswahili"
12 "Computer Science"
13 "Literature"
-66 "Other(specify)";
#delimit cr

label val oth_subj_211_41 oth_subj_211_41lab
lab var oth_subj_211_41 "211_4_Which other subjects does the teacher [name] teach?"
lab var oth_subj_211_42 "211_4_Which other subjects does the teacher [name] teach?"

replace oth_subj_211_42="-66" if oth_subj_211_42=="other"
destring oth_subj_211_42, replace 
#delimit ;
label define oth_subj_211_42lab
1 "Physics"
2 "Chemistry"
3 "Maths"
4 "Biology"
5 "Geography"
6 "Economics"
7 "History"
8 "English"
9 "French"
10 "Kinyarwanda"
11 "Kiswahili"
12 "Computer Science"
13 "Literature"
-66 "Other(specify)";
#delimit cr

label val oth_subj_211_42 oth_subj_211_42lab

     *Teacher 5
replace opt_2115="" if opt_2115=="-55"
destring oth_subj_211_5, replace 
#delimit ;
label define oth_subj_211_5lab
1 "Physics"
2 "Chemistry"
3 "Maths"
4 "Biology"
5 "Geography"
6 "Economics"
7 "History"
8 "English"
9 "French"
10 "Kinyarwanda"
11 "Kiswahili"
12 "Computer Science"
13 "Literature"
-66 "Other(specify)";
#delimit cr

label val oth_subj_211_5 oth_subj_211_5lab

drop oth_subj_211__other5

		*Level taught
forval i=1/5{
	split(lev_taught_211_`i'), parse("")
}

	*S1
forval i=1/6{
	gen lev_taught_211_1S`i'=0
}

lab def yesnolbl 1 Yes 0 No
forval k=1/6 {
	replace lev_taught_211_1S1=1 if lev_taught_211_1`k'=="1"
	replace lev_taught_211_1S2=1 if lev_taught_211_1`k'=="2"
	replace lev_taught_211_1S3=1 if lev_taught_211_1`k'=="3"
	replace lev_taught_211_1S4=1 if lev_taught_211_1`k'=="4"
	replace lev_taught_211_1S5=1 if lev_taught_211_1`k'=="5"
	replace lev_taught_211_1S6=1 if lev_taught_211_1`k'=="6"
}
forval i=1/6{
lab val lev_taught_211_1S`i' yesnolbl
lab var lev_taught_211_1S`i' "Does Name_211_1 teach S"
}
forval i=1/6{
drop lev_taught_211_1`i'
}
order lev_taught_211_1S1-lev_taught_211_1S6, after(lev_taught_211_1)

	*S2

forval i=1/6{
	gen lev_taught_211_2S`i'=0
}

forval k=1/6 {
	replace lev_taught_211_2S1=1 if lev_taught_211_2`k'=="1"
	replace lev_taught_211_2S2=1 if lev_taught_211_2`k'=="2"
	replace lev_taught_211_2S3=1 if lev_taught_211_2`k'=="3"
	replace lev_taught_211_2S4=1 if lev_taught_211_2`k'=="4"
	replace lev_taught_211_2S5=1 if lev_taught_211_2`k'=="5"
	replace lev_taught_211_2S6=1 if lev_taught_211_2`k'=="6"
}
forval i=1/6{
lab val lev_taught_211_2S`i' yesnolbl
lab var lev_taught_211_2S`i' "Does Name_211_2 teach S"
}
forval i=1/6{
drop lev_taught_211_2`i'
}
order lev_taught_211_2S1-lev_taught_211_2S6, after(lev_taught_211_2)


	*S3
forval i=1/6{
	gen lev_taught_211_3S`i'=0
}

forval k=1/5 {
	replace lev_taught_211_3S1=1 if lev_taught_211_3`k'=="1"
	replace lev_taught_211_3S2=1 if lev_taught_211_3`k'=="2"
	replace lev_taught_211_3S3=1 if lev_taught_211_3`k'=="3"
	replace lev_taught_211_3S4=1 if lev_taught_211_3`k'=="4"
	replace lev_taught_211_3S5=1 if lev_taught_211_3`k'=="5"
	replace lev_taught_211_3S6=1 if lev_taught_211_3`k'=="6"
}
forval i=1/6{
lab val lev_taught_211_3S`i' yesnolbl
lab var lev_taught_211_3S`i' "Does Name_211_3 teach S"
}
forval i=1/5{
drop lev_taught_211_3`i'
}
order lev_taught_211_3S1-lev_taught_211_3S5, after(lev_taught_211_3)
order lev_taught_211_3S6, after(lev_taught_211_3S5)

	*S4

forval i=1/6{
	gen lev_taught_211_4S`i'=0
}

forval k=1/4 {
	replace lev_taught_211_4S1=1 if lev_taught_211_4`k'=="1"
	replace lev_taught_211_4S2=1 if lev_taught_211_4`k'=="2"
	replace lev_taught_211_4S3=1 if lev_taught_211_4`k'=="3"
	replace lev_taught_211_4S4=1 if lev_taught_211_4`k'=="4"
	replace lev_taught_211_4S5=1 if lev_taught_211_4`k'=="5"
	replace lev_taught_211_4S6=1 if lev_taught_211_4`k'=="6"
}
forval i=1/6{
lab val lev_taught_211_4S`i' yesnolbl
lab var lev_taught_211_4S`i' "Does Name_211_4 teach S"
}
forval i=1/4{
drop lev_taught_211_4`i'
}
order lev_taught_211_4S1-lev_taught_211_4S6, after(lev_taught_211_4)

	*S5


forval i=1/6{
	gen lev_taught_211_5S`i'=0
}

forval k=1/1 {
	replace lev_taught_211_5S1=1 if lev_taught_211_5`k'=="1"
	replace lev_taught_211_5S2=1 if lev_taught_211_5`k'=="2"
	replace lev_taught_211_5S3=1 if lev_taught_211_5`k'=="3"
	replace lev_taught_211_5S4=1 if lev_taught_211_5`k'=="4"
	replace lev_taught_211_5S5=1 if lev_taught_211_5`k'=="5"
	replace lev_taught_211_5S6=1 if lev_taught_211_5`k'=="6"
}
forval i=1/6{
	lab val lev_taught_211_5S`i' yesnolbl
	lab var lev_taught_211_5S`i' "Does Name_211_5 teach S"
}
forval i=1/1{
drop lev_taught_211_5`i'
}
order lev_taught_211_5S1-lev_taught_211_5S6, after(lev_taught_211_5)
	
		**Stream
forval i=1/5{
split stream_211_`i', parse("")
}

			*Stream 211
local stream1 "A B C D" 
foreach x of local stream1 {
	gen stream_211_1`x'=0
}

forval i=1/4{
	replace stream_211_1A=1 if stream_211_1`i'=="A"
	replace stream_211_1B=1 if stream_211_1`i'=="B"
	replace stream_211_1C=1 if stream_211_1`i'=="C"
	replace stream_211_1D=1 if stream_211_1`i'=="D"
}
local stream1 "A B C D" 
foreach x of local stream1{
	lab val stream_211_1`x' yesnolbl
	lab var stream_211_1`x' "What is the stream of Name_211_1 ?"
}

order stream_211_1A-stream_211_1D , after (stream_211_1)

		*Stream 211_2

local stream2 "A B C D E" 
foreach x of local stream2 {
	gen stream_211_2`x'=0
}

forval i=1/5{
	replace stream_211_2A=1 if stream_211_2`i'=="A"
	replace stream_211_2B=1 if stream_211_2`i'=="B"
	replace stream_211_2C=1 if stream_211_2`i'=="C"
	replace stream_211_2D=1 if stream_211_2`i'=="D"
	replace stream_211_2E=1 if stream_211_2`i'=="D"
}
local stream2 "A B C D E" 
foreach x of local stream2{
	lab val stream_211_2`x' yesnolbl
	lab var stream_211_2`x' "What is the stream of Name_211_2?"
}

order stream_211_2A-stream_211_2E , after (stream_211_2)

		*Stream 211_3
local stream3 "A B C D E" 
foreach x of local stream3 {
	gen stream_211_3`x'=0
}

forval i=1/5{
	replace stream_211_3A=1 if stream_211_3`i'=="A"
	replace stream_211_3B=1 if stream_211_3`i'=="B"
	replace stream_211_3C=1 if stream_211_3`i'=="C"
	replace stream_211_3D=1 if stream_211_3`i'=="D"
	replace stream_211_3E=1 if stream_211_3`i'=="E"
}
local stream3 "A B C D E" 
foreach x of local stream3{
	lab val stream_211_3`x' yesnolbl
	lab var stream_211_3`x' "What is the stream of Name_211_3?"
}

order stream_211_3A-stream_211_3E , after (stream_211_3)

	
		*Stream 211_4
local stream4 "A B C D E" 
foreach x of local stream4 {
	gen stream_211_4`x'=0
}

forval i=1/5{
	replace stream_211_4A=1 if stream_211_4`i'=="A"
	replace stream_211_4B=1 if stream_211_4`i'=="B"
	replace stream_211_4C=1 if stream_211_4`i'=="C"
	replace stream_211_4D=1 if stream_211_4`i'=="D"
	replace stream_211_4E=1 if stream_211_4`i'=="E"
}
local stream4 "A B C D E" 
foreach x of local stream4{
	lab val stream_211_4`x' yesnolbl
	lab var stream_211_4`x' "What is the stream of Name_211_4?"
}

order stream_211_4A-stream_211_4E , after(stream_211_4)

	
		*Stream 211_5

global stream5 "A B C D E " 
foreach x of global stream5 {
	gen stream_211_5`x'=0
}

forval i=1/2{
	replace stream_211_5A=1 if stream_211_5`i'=="A"
	replace stream_211_5B=1 if stream_211_5`i'=="B"
	replace stream_211_5C=1 if stream_211_5`i'=="C"
	replace stream_211_5D=1 if stream_211_5`i'=="D"
	replace stream_211_5E=1 if stream_211_5`i'=="E"
}

foreach x of global stream5{
	lab val stream_211_5`x' yesnolbl
	lab var stream_211_5`x' "What is the stream of Name_211_5?"
}

order stream_211_5A-stream_211_5E , after(stream_211_5)
drop stream_211_11-stream_211_52


	*Exp_teach_211_1
	
forval i=1/5{
	replace exp_teach_211_`i'=. if inlist(exp_teach_211_`i',-55,-99)

}
	
	*212
replace rec_attend_opts_212=2 if key=="uuid:95ab5139-4dd8-4ffb-af71-f805c611f105"
replace rec_attend_212=2 if key=="uuid:9cc35d87-6f0d-47b0-9c62-8106cca38840"
replace rec_attend_opts_212=1 if key=="uuid:dbae39eb-04a7-4b87-94fc-4269d73d7ee1"
replace rec_attend_opts_212=1 if key=="uuid:8bac3028-a4cf-4513-a73b-679d28c9b138"

drop rec_attend_212
lab var rec_attend_opts_212 "212_Do you have records of the teachers's attendance?"
replace rec_attend_opts_212=0 if rec_attend_opts_212==.
lab def reclbl 0 "No" 1 "Yes, did not show records" 2 "Yes, showed records"
lab val rec_attend_opts_212 reclbl
rename rec_attend_opts_212 rec_attend_212

    *213
*Some answers were -88 "Refused to answer" and they are treated as missing values (.)

replace abs_tues1_213=2 if key=="uuid:95ab5139-4dd8-4ffb-af71-f805c611f105"
replace abs_tues2_213=2	if key=="uuid:95ab5139-4dd8-4ffb-af71-f805c611f105"
replace abs_tues3_213=4 if key=="uuid:95ab5139-4dd8-4ffb-af71-f805c611f105"
replace abs_tues1_213=2	if key=="uuid:96d67c96-aa34-416e-9a48-84247cbe0d3c"
replace abs_tues1_213=1	if key=="uuid:96d67c96-aa34-416e-9a48-84247cbe0d3c"
replace abs_tues3_213=1 if key=="uuid:96d67c96-aa34-416e-9a48-84247cbe0d3c"

replace abs_tues1_213=. if abs_tues1_213==-55	
replace abs_tues2_213=. if abs_tues2_213==-55	
replace abs_tues3_213=. if abs_tues3_213==-55
replace abs_tues1_213=. if abs_tues1_213==-77	
replace abs_tues2_213=. if abs_tues2_213==-77	
replace abs_tues3_213=. if abs_tues3_213==-77
replace abs_tues1_213=. if abs_tues1_213==-99	
replace abs_tues2_213=. if abs_tues2_213==-99	
replace abs_tues3_213=. if abs_tues3_213==-99
	
	*215
foreach var in a_elec_215 b_gen_215 c_solar_215{
replace `var'=. if `var'==-55
replace `var'=0 if `var'==.

}

	*216
replace elec_avail_216=. if elec_avail_216==-55
replace elec_avail_216=. if elec_avail_216==-77
replace elec_avail_216=0 if key=="uuid:04e65842-bc59-435d-b684-f5bef9d949a5"
replace elec_avail_216=1 if key=="uuid:c2037010-bfdb-4e9b-91c3-965b3b486e29"
replace elec_avail_216=.  if a_elec_215==0 & b_gen_215==0 & c_solar_215==0


// 3.SCHOOL FINANCES AND RESOURCES 

	*301
	*replace amt_fees_301=. if amt_fees_301==-99
	*replace amt_fees_301=. if amt_fees_301==-33


replace amt_fees_301=12000000 if key=="uuid:8c9af9cb-f6f0-4e99-af7b-701bb5baa4bd" 
replace amt_fees_301=. if amt_fees_301==-55
replace amt_fees_301=. if amt_fees_301==-88
replace amt_fees_301=. if amt_fees_301==1
replace amt_fees_301=. if amt_fees_301==33
replace amt_fees_301=36500 if school_code_107=="0405106"

replace amt_fees_301=-99 if amt_fees_301==. & fees_parents_300==1


    *302
replace textb_govt_302="" if textb_govt_302=="-55"
replace textb_govt_302="-99" if textb_govt_302=="-77"
replace textb_govt_302="-99" if textb_govt_302=="- 99"

replace textb_govt_302="0" if textb_govt_302=="O"

replace money_govt_302="" if money_govt_302=="-55"
replace money_ngo_302="" if money_ngo_302=="-55"
replace money_committee_302="" if money_committee_302=="-55"
replace textb_govt_302="206" if key=="uuid:8c9af9cb-f6f0-4e99-af7b-701bb5baa4bd"

replace textb_ngo_302="" if textb_ngo_302=="-77"
replace textb_ngo_302="" if textb_ngo_302=="- 77"
replace textb_ngo_302="" if textb_ngo_302=="-55"

replace textb_committee_302="" if textb_committee_302=="- 77"
replace textb_committee_302="" if textb_committee_302=="-77"
replace textb_committee_302="" if textb_committee_302=="-55"

replace money_govt_302="" if money_govt_302=="-77"
replace money_govt_302="-99" if money_govt_302=="- 99"
replace money_ngo_302="" if money_ngo_302=="-77"
replace money_ngo_302="" if money_ngo_302=="- 77"

replace money_committee_302="" if money_committee_302=="-77"
replace money_committee_302="" if money_committee_302=="- 77"
replace money_committee_302="-99" if money_committee_302=="- 99"
replace textb_ngo_302="0" if key=="uuid:8c9af9cb-f6f0-4e99-af7b-701bb5baa4bd"



foreach var in textb_ngo_302 money_govt_302 textb_committee_302{
replace `var'="0" if `var'==""
replace `var'="-1010" if `var'=="XX"|`var'=="Xx"|`var'=="xX"|`var'=="xx"
destring `var',replace
}


foreach var in textb_govt_302 money_ngo_302 money_committee_302{
replace `var'="0" if `var'==""
replace `var'="-1010" if `var'=="XX"|`var'=="Xx"|`var'=="xX"|`var'=="xx"
destring `var',replace
}






// 4. SCHOOL MANAGEMENT
    *400
replace break_time=75 if school_code_107=="0405106" 
replace break_time=3500 if school_code_107=="0305131"
replace break_time=1050 if school_code_107=="0403122"

replace break_time=. if break_time==-55
foreach v in opening_time closing_time break_time{
renam `v' `v'_400

}

    *401
replace days_closed=1 if days_closed==550
rename days_closed days_closed_401

	*402
replace reas_closed="-66" if reas_closed=="other"
destring reas_closed, replace 
lab def reaslbl 1 "Strike" 2 "Rain/Storm(Weather)" 3 "Lack of resources" 4 "Training (teachers)" -66 "Other(specify)"
lab val reas_closed	reaslbl
rename reas_closed reas_closed_402
rename reas_closed_other reas_closed_other_402
	*404
replace know_date_404=. if know_date_404==-55
rename instr_time_lost instr_time_lost_403
rename date_meeting date_meeting_404
replace know_date_404=0 if date_meeting==.

     *405
replace devplan_spec="" if devplan_spec=="- 55"
replace devplan_spec="" if devplan_spec=="-- 55"
replace devplan_spec="" if devplan_spec=="-55"
replace devplan_spec="" if devplan_spec=="-99"
replace devplan_spec="" if devplan_spec=="2"
replace devplan_spec="" if devplan_spec=="1260"
replace devplan_spec="" if key=="uuid:36e2c6ed-a9d9-45d2-be4c-145dbb7420ad"
rename devplan devplan_405
rename devplan_spec devplan_spec_405



      *406
replace teach_hrs=1332 if devplan_spec=="1332"
replace devplan_spec="" if devplan_spec=="1332"
replace teach_hrs=1080 if devplan_spec=="1080"
replace devplan_spec="" if devplan_spec=="1080"
replace teach_hrs=1280 if devplan_spec=="1280"
replace devplan_spec="" if devplan_spec=="1280"
replace teach_hrs=342 if teach_hrs==2
replace teach_hrs=-99 if teach_hrs==0
replace teach_hrs=1206 if school_code_107=="405012"
replace teach_hrs=1440 if school_code_107=="0405102"
replace teach_hrs=4933.33 if school_code_107=="0401122" 



rename teach_hrs teach_hrs_406
	
	 *407
replace cond_records=1 if key=="uuid:0f277224-8b5d-460f-8b95-6ffed142847f"	
rename cond_records cond_records_407

    *408
replace school_exams=3 if key=="uuid:0f277224-8b5d-460f-8b95-6ffed142847f"
rename school_exams school_exams_408
	*409
rename anal_res anal_res_409
	*410
replace anal_res_actions="1 2" if key=="uuid:1260058b-1b21-4d7f-a6dc-ffda8fdec59a"
replace anal_res_actions="1" if key=="uuid:75ba5b28-dc46-45ba-9df5-43928be3bdf5"
replace anal_res_actions_other="" if key=="uuid:75ba5b28-dc46-45ba-9df5-43928be3bdf5"
replace anal_res_actions="1 2" if key=="uuid:572f9e73-541c-426d-a8df-757f49c84328"
replace anal_res_actions_other="" if key=="uuid:572f9e73-541c-426d-a8df-757f49c84328"

split (anal_res_actions), parse("")
gen anal_res_actions_LowestPerf=0
gen anal_res_actions_DividedResults=0
gen anal_res_actions_Other=0

foreach var in anal_res_actions1 anal_res_actions2{
replace anal_res_actions_LowestPerf=1 if `var'=="1"
replace anal_res_actions_DividedResults=1 if `var'=="2"
replace anal_res_actions_Other=1 if `var'=="other"
}
order anal_res_actions_LowestPerf anal_res_actions_DividedResults anal_res_actions_Other,after(anal_res_actions)
*lab def yesnolbl 1 Yes 0 No


foreach var in anal_res_actions_LowestPerf anal_res_actions_DividedResults anal_res_actions_Other{
lab var `var' "410_What did you do to analyze the results"
lab val  `var' yesnolbl
}
drop anal_res_actions1 anal_res_actions2 


		*411
split(punish_stud), parse ("")

gen punish_stud_ExtraSchoolWork=0
gen punish_stud_ExtraNonSchoolWork=0
gen punish_stud_DenyBreak=0
gen punish_stud_Dismiss=0
gen punish_stud_SpeakParents=0
gen punish_stud_GiveWarning=0
gen punish_stud_DoNotPunish=0

foreach var in punish_stud1 punish_stud2 punish_stud3 punish_stud4 punish_stud5 punish_stud6{
replace punish_stud_ExtraSchoolWork=1 if `var'=="1"
replace punish_stud_ExtraNonSchoolWork=1 if `var'=="2"
replace punish_stud_DenyBreak=1 if `var'=="3"
replace punish_stud_Dismiss=1 if `var'=="4"
replace punish_stud_SpeakParents=1 if `var'=="5"
replace punish_stud_GiveWarning=1  if `var'=="6"
replace punish_stud_DoNotPunish=1  if `var'=="7"
}
drop punish_stud1-punish_stud6

foreach var in punish_stud_ExtraSchoolWork punish_stud_ExtraNonSchoolWork punish_stud_DenyBreak punish_stud_Dismiss punish_stud_SpeakParents punish_stud_GiveWarning punish_stud_DoNotPunish{
lab var `var' "411_How do you punish bad behavior from students, if you do"
lab val `var' yesnolbl
}
order punish_stud_ExtraSchoolWork punish_stud_ExtraNonSchoolWork punish_stud_DenyBreak punish_stud_Dismiss punish_stud_SpeakParents punish_stud_GiveWarning punish_stud_DoNotPunish , after(punish_stud_other)
order punish_stud_other, after(punish_stud_DoNotPunish)

	*412
split (reward_stud), parse ("")
gen reward_stud_PublicPraise=0
gen reward_stud_PrivatePraise=0
gen reward_stud_PrizesIncentives=0
gen reward_stud_DoNotRewardGoodBehv=0

forva i=1/3{
replace reward_stud_PublicPraise=1 if reward_stud`i'=="1"
replace reward_stud_PrivatePraise=1 if reward_stud`i'=="2"
replace reward_stud_PrizesIncentives=1 if reward_stud`i'=="3"
replace reward_stud_DoNotRewardGoodBehv=1 if  reward_stud`i'=="4"
}

foreach var in reward_stud_PublicPraise reward_stud_PrivatePraise reward_stud_PrizesIncentives reward_stud_DoNotRewardGoodBehv{
lab var `var'  "412_How do you reward good behavior from students, if you do?"
lab val `var' yesnolbl
}

drop reward_stud1 reward_stud2 reward_stud3
order reward_stud_PublicPraise reward_stud_PrivatePraise reward_stud_PrizesIncentives reward_stud_DoNotRewardGoodBehv, after(reward_stud)
rename reward_stud reward_stud_412

	*413
replace add_teach=0 if number_add_teach==.
rename add_teach add_teach_413
	*414
replace number_add_teach=. if number_add_teach==-55
replace number_add_teach=. if number_add_teach==-99
rename number_add_teach number_add_teach_414

	*415 fact_hiring

split (fact_hiring), parse("")
gen fact_hiring_Qualif=0
gen fact_hiring_Ttraining=0
gen fact_hiring_Age=0
gen fact_hiring_Gender=0
gen fact_hiring_Distance=0
gen fact_hiring_Experience=0
gen fact_hiring_PriorExpThisSchool=0
gen fact_hiring_PriorExpAnySchool=0
gen fact_hiring_LTInterest=0
gen fact_hiring_Recomm=0

forval i=1/4{
replace fact_hiring_Qualif=1 if fact_hiring`i'=="1"
replace fact_hiring_Ttraining=1 if fact_hiring`i'=="2"
replace fact_hiring_Age=1 if fact_hiring`i'=="3"
replace fact_hiring_Gender=1 if fact_hiring`i'=="4"
replace fact_hiring_Distance=1 if fact_hiring`i'=="5"
replace fact_hiring_Experience=1 if fact_hiring`i'=="6"
replace fact_hiring_PriorExpThisSchool=1 if fact_hiring`i'=="7"
replace fact_hiring_PriorExpAnySchool=1 if fact_hiring`i'=="8"
replace fact_hiring_LTInterest=1 if fact_hiring`i'=="9"
replace fact_hiring_Recomm=1 if fact_hiring`i'=="10"
}
foreach var in fact_hiring_Qualif fact_hiring_Ttraining fact_hiring_Age fact_hiring_Gender fact_hiring_Distance fact_hiring_Experience fact_hiring_PriorExpThisSchool fact_hiring_PriorExpAnySchool fact_hiring_LTInterest fact_hiring_Recomm{
lab var `var' "415_What are the three most important factors that should be considered in the selection process for hiring teachers"
lab val `var' yesnolbl
}
forval i=1/4{
drop fact_hiring`i'
}
order fact_hiring_Qualif fact_hiring_Ttraining fact_hiring_Age fact_hiring_Gender fact_hiring_Distance fact_hiring_Experience fact_hiring_PriorExpThisSchool fact_hiring_PriorExpAnySchool fact_hiring_LTInterest fact_hiring_Recomm , before(fact_hiring_other)

*416
replace priv_school=. if priv_school==-55
replace priv_school=. if priv_school==-77	
replace publ_school=. if publ_school==-55

foreach v in priv_school publ_school{
replace `v'=-99 if `v'==.
replace `v'=-77 if `v'==0
rename `v' `v'_416
}

// 5. COMMUNITY PARTICIPATION
	
	*500
rename parent_meet parent_meet_500

    *501
replace times_meet=1 if key=="uuid:9cc35d87-6f0d-47b0-9c62-8106cca38840"
rename times_meet times_meet_501
	*502
split (chall_learn),parse ("")
forval i=1/2{
replace chall_learn`i'="-66" if chall_learn`i'=="other"
destring chall_learn`i', replace 
}
replace chall_learn=""
destring chall_learn,replace
replace chall_learn=chall_learn1
lab def chalbl 1"Lack of resources/materials/furniture" 2 "Lack of appropriate training of teachers" 3 "Lack of community participation" 4 "Lack of enthusiasm from the students" 5 "Lack of enthusiasm from the teachers" -66 "Other(specify)"
lab val chall_learn chalbl
replace chall_learn=. if chall_learn==-55
drop chall_learn1 chall_learn2
replace chall_learn=-66 if chall_learn==.

rename chall_learn chall_learn_502 


// 6. PEDAGOGY AND COMPETENCE-BASED CURRICULUM
	*600

split (teach_meth_mostcomf), parse ("")
g teach_meth_mostcomf_Lect=0 
g teach_meth_mostcomf_QandA=0 
g teach_meth_mostcomf_Quiz=0 
g teach_meth_mostcomf_GroupWork=0 
g teach_meth_mostcomf_Games=0 
g teach_meth_mostcomf_Discussion=0 
g teach_meth_mostcomf_ActOutClass=0 
g teach_meth_mostcomf_ReadFromText=0 
g teach_meth_mostcomf_PracticeEx=0 
g teach_meth_mostcomf_Research=0 
g teach_meth_mostcomf_Experiment=0 

forval i=1/3{
destring teach_meth_mostcomf`i',replace
replace teach_meth_mostcomf_Lect=1 if teach_meth_mostcomf`i'==1
replace teach_meth_mostcomf_QandA=1 if teach_meth_mostcomf`i'==2
replace teach_meth_mostcomf_Quiz=1 if teach_meth_mostcomf`i'==3
replace teach_meth_mostcomf_GroupWork=1 if teach_meth_mostcomf`i'==4
replace teach_meth_mostcomf_Games=1 if teach_meth_mostcomf`i'==5
replace teach_meth_mostcomf_Discussion=1 if teach_meth_mostcomf`i'==6
replace teach_meth_mostcomf_ActOutClass=1 if teach_meth_mostcomf`i'==7
replace teach_meth_mostcomf_ReadFromText=1 if teach_meth_mostcomf`i'==8
replace teach_meth_mostcomf_PracticeEx=1 if teach_meth_mostcomf`i'==9
replace teach_meth_mostcomf_Research=1 if teach_meth_mostcomf`i'==10
replace teach_meth_mostcomf_Experiment=1 if teach_meth_mostcomf`i'==11
}
foreach var in teach_meth_mostcomf_PracticeEx teach_meth_mostcomf_ActOutClass teach_meth_mostcomf_Discussion teach_meth_mostcomf_Experiment teach_meth_mostcomf_Games teach_meth_mostcomf_GroupWork teach_meth_mostcomf_Lect teach_meth_mostcomf_QandA teach_meth_mostcomf_Quiz teach_meth_mostcomf_ReadFromText teach_meth_mostcomf_Research{
lab var `var' "600_What are the most three(3) teaching methods or pedagogies your teachers are most comfortable using?"
lab val `var' yesnolbl
}

forval i=1/3{
drop teach_meth_mostcomf`i'
}

order teach_meth_mostcomf_QandA teach_meth_mostcomf_Quiz teach_meth_mostcomf_GroupWork teach_meth_mostcomf_Games teach_meth_mostcomf_Discussion teach_meth_mostcomf_ActOutClass teach_meth_mostcomf_ReadFromText teach_meth_mostcomf_PracticeEx teach_meth_mostcomf_Research teach_meth_mostcomf_Experiment, after (teach_meth_mostcomf)
order teach_meth_mostcomf_Lect, after(teach_meth_mostcomf)

	*601

split (teach_meth_leastcomf), parse ("")
g teach_meth_leastcomf_Lect=0 
g teach_meth_leastcomf_QandA=0 
g teach_meth_leastcomf_Quiz=0 
g teach_meth_leastcomf_GroupWork=0 
g teach_meth_leastcomf_Games=0 
g teach_meth_leastcomf_Discussion=0 
g teach_meth_leastcomf_ActOutClass=0 
g teach_meth_leastcomf_ReadFromTex=0 
g teach_meth_leastcomf_PracticeEx=0 
g teach_meth_leastcomf_Research=0 
g teach_meth_leastcomf_Experiment=0 

forval i=1/3{
destring teach_meth_leastcomf`i',replace
replace teach_meth_leastcomf_Lect=1 if teach_meth_leastcomf`i'==1
replace teach_meth_leastcomf_QandA=1 if teach_meth_leastcomf`i'==2
replace teach_meth_leastcomf_Quiz=1 if teach_meth_leastcomf`i'==3
replace teach_meth_leastcomf_GroupWork=1 if teach_meth_leastcomf`i'==4
replace teach_meth_leastcomf_Games=1 if teach_meth_leastcomf`i'==5
replace teach_meth_leastcomf_Discussion=1 if teach_meth_leastcomf`i'==6
replace teach_meth_leastcomf_ActOutClass=1 if teach_meth_leastcomf`i'==7
replace teach_meth_leastcomf_ReadFromTex=1 if teach_meth_leastcomf`i'==8
replace teach_meth_leastcomf_PracticeEx=1 if teach_meth_leastcomf`i'==9
replace teach_meth_leastcomf_Research=1 if teach_meth_leastcomf`i'==10
replace teach_meth_leastcomf_Experiment=1 if teach_meth_leastcomf`i'==11
}
foreach var in teach_meth_leastcomf_PracticeEx teach_meth_leastcomf_ActOutClass teach_meth_leastcomf_Discussion teach_meth_leastcomf_Experiment teach_meth_leastcomf_Games teach_meth_leastcomf_GroupWork teach_meth_leastcomf_Lect teach_meth_leastcomf_QandA teach_meth_leastcomf_Quiz teach_meth_leastcomf_ReadFromTex teach_meth_leastcomf_Research{
lab var `var' "601_What are the least three(3) teaching methods or pedagogies your teachers are most comfortable using?"
lab val `var' yesnolbl
}

forval i=1/3{
drop teach_meth_leastcomf`i'
}

order teach_meth_leastcomf_Lect teach_meth_leastcomf_QandA teach_meth_leastcomf_Quiz teach_meth_leastcomf_GroupWork teach_meth_leastcomf_Games teach_meth_leastcomf_Discussion teach_meth_leastcomf_ActOutClass teach_meth_leastcomf_ReadFromTex teach_meth_leastcomf_PracticeEx teach_meth_leastcomf_Research teach_meth_leastcomf_Experiment, after (teach_meth_leastcomf)
	
	*602
replace club_spec="" if club_spec=="-55"
replace club_spec="" if club_spec=="-99"
rename coach_clubs coach_clubs_602

	*606
*goal_teach_606
replace goal_teach_606="-66" if goal_teach_606=="other"|goal_teach_606=="3 other"
destring goal_teach_606, replace
replace goal_teach_606=. if goal_teach_606==-55
lab def goaltlbl 1"Develop student knowledge" 2 "Develop student skills and attitudes" 3 "Develop student knowledge,skills,and attitude" -66 "Other(specify)"
lab val goal_teach_606 goaltlbl

	*607
split (meth_5_607), parse ("")
g meth_5_607_Lect=0 
g meth_5_607_QandA=0 
g meth_5_607_Quiz=0 
g meth_5_607_GroupWork=0 
g meth_5_607_Games=0 
g meth_5_607_Discussion=0 
g meth_5_607_ActOutClass=0 
g meth_5_607_ReadFromText=0 
g meth_5_607_PracticeEx=0 
g meth_5_607_Research=0 
g meth_5_607_Experiment=0 
g meth_5_607_Portfolio=0 

forval i=1/5{
destring meth_5_607`i',replace
replace meth_5_607_Lect=1 if meth_5_607`i'==1
replace meth_5_607_QandA=1 if meth_5_607`i'==2
replace meth_5_607_Quiz=1 if meth_5_607`i'==3
replace meth_5_607_GroupWork=1 if meth_5_607`i'==4
replace meth_5_607_Games=1 if meth_5_607`i'==5
replace meth_5_607_Discussion=1 if meth_5_607`i'==6
replace meth_5_607_ActOutClass=1 if meth_5_607`i'==7
replace meth_5_607_ReadFromText=1 if meth_5_607`i'==8
replace meth_5_607_PracticeEx=1 if meth_5_607`i'==9
replace meth_5_607_Research=1 if meth_5_607`i'==10
replace meth_5_607_Experiment=1 if meth_5_607`i'==11
replace meth_5_607_Portfolio=1 if meth_5_607`i'==12
}
foreach var in meth_5_607_Portfolio meth_5_607_PracticeEx meth_5_607_ActOutClass meth_5_607_Discussion meth_5_607_Experiment meth_5_607_Games meth_5_607_GroupWork meth_5_607_Lect meth_5_607_QandA meth_5_607_Quiz meth_5_607_ReadFromText meth_5_607_Research{
lab var `var' "607_Which five(5)teaching methods do you think are least effective at preparing students to pass exams?"
lab val `var' yesnolbl
}

forval i=1/5{
drop meth_5_607`i'
}

order meth_5_607_Lect meth_5_607_QandA meth_5_607_Quiz meth_5_607_GroupWork meth_5_607_Games meth_5_607_Discussion meth_5_607_ActOutClass meth_5_607_ReadFromText meth_5_607_PracticeEx meth_5_607_Research meth_5_607_Experiment meth_5_607_Portfolio, after (meth_5_607)

	*608
destring freq_comp_608, replace
lab def complabl 1 "Every lesson" 2 "Once or twice every week" 3 "Once or twice every month" 4 "Once or twice every term" 5 "Once or twice every year" 6 "Only once or twice ever" 7 "Never"
lab val freq_comp_608 complabl

	*609
replace learn_comp_609="-66" if learn_comp_609=="other"
destring learn_comp_609, replace
lab def comlbl 1 "A REB training" 2 "A training not by REB" 3 "I, as Headmaster(school principal), trained them" 4 "A teacher from my school trained the others" 5 "A teacher from another school trained my teachers" 6 "Teachers researched and read to learn it on their own" -66 "Other(specify)"
lab val learn_comp_609 comlbl

    *610
replace skilllab_610=0 if key=="uuid:8c9af9cb-f6f0-4e99-af7b-701bb5baa4bd"
replace skilllab_610=0 if key=="uuid:d9da1c76-ddf9-4cd6-9f55-9f3503e3b32b"
replace skilllab_610=0 if key=="uuid:96d67c96-aa34-416e-9a48-84247cbe0d3c"
replace skilllab_610=0 if key=="uuid:f1aa53bf-43f6-4572-bdd3-b773203caee2"
replace skilllab_610=0 if key=="uuid:50b1f853-92f6-426a-8fcf-f16a89254151"
replace skilllab_610=0 if key=="uuid:245a98d3-faa0-46cd-ac32-42cbd42d5cdb"
replace skilllab_610=0 if key=="uuid:413bdd73-047b-4797-a099-ba725246da01"
replace skilllab_610=0 if key=="uuid:4e02290a-4ba3-482a-aa29-feab756bee09"
replace skilllab_610=0 if key=="uuid:e68ca611-cf82-40a9-93cd-1b322577b8ca"

	*611
destring def_skilllab_611, replace 
replace def_skilllab_611=. if def_skilllab_611==-55
lab def skilbbl 1 "A time after school for students to do activities" 2 "A special lesson during the regular entrepreneurship less." 3" A lab session for science students" 4 "A time for students to start student business" -99 "Don't know"
lab val def_skilllab_611 skilbbl
replace def_skilllab_611=-99 if skilllab_610==1 & def_skilllab_611==.


	*613
replace reas_613="-66" if reas_613=="other"
replace reas_613="" if reas_613=="-55"



destring reas_613, replace
#delimit ;
label define reas_613lab
1 "Never been trained on it" 
2 "Never heard of it" 
3 "Dont agree with it" 
4 "Have not had time to start using it" 
5 "Do not have the materials to use it" 
-66 "Other(specify)";
#delimit cr

lab val reas_613 reas_613lab
replace not_comp_612=0 if not_comp_612==1 & reas_613==.

	*614

split (meth_3_614), parse ("")
g meth_3_614_Lect=0 
g meth_3_614_QandA=0 
g meth_3_614_Quiz=0 
g meth_3_614_GroupWork=0 
g meth_3_614_Games=0 
g meth_3_614_Discussion=0 
g meth_3_614_ActOutClass=0 
g meth_3_614_ReadFromText=0 
g meth_3_614_PracticeEx=0 
g meth_3_614_Research=0 
g meth_3_614_Experiment=0 
g meth_3_614_Portfolio=0 
forval i=1/3{
destring meth_3_614`i',replace
replace meth_3_614_Lect=1 if meth_3_614`i'==1
replace meth_3_614_QandA=1 if meth_3_614`i'==2
replace meth_3_614_Quiz=1 if meth_3_614`i'==3
replace meth_3_614_GroupWork=1 if meth_3_614`i'==4
replace meth_3_614_Games=1 if meth_3_614`i'==5
replace meth_3_614_Discussion=1 if meth_3_614`i'==6
replace meth_3_614_ActOutClass=1 if meth_3_614`i'==7
replace meth_3_614_ReadFromText=1 if meth_3_614`i'==8
replace meth_3_614_PracticeEx=1 if meth_3_614`i'==9
replace meth_3_614_Research=1 if meth_3_614`i'==10
replace meth_3_614_Experiment=1 if meth_3_614`i'==11
replace meth_3_614_Portfolio=1 if meth_3_614`i'==12
}
foreach var in meth_3_614_Portfolio meth_3_614_PracticeEx meth_3_614_ActOutClass meth_3_614_Discussion meth_3_614_Experiment meth_3_614_Games meth_3_614_GroupWork meth_3_614_Lect meth_3_614_QandA meth_3_614_Quiz meth_3_614_ReadFromText meth_3_614_Research{
lab var `var' "614_Which three (3) teaching methods do you believe are most effective for teaching entrepreneurship subject?"
lab val `var' yesnolbl
}

forval i=1/3{
drop meth_3_614`i'
}

order meth_3_614_Lect meth_3_614_QandA meth_3_614_Quiz meth_3_614_GroupWork meth_3_614_Games meth_3_614_Discussion meth_3_614_ActOutClass meth_3_614_ReadFromText meth_3_614_PracticeEx meth_3_614_Research meth_3_614_Experiment meth_3_614_Portfolio, after (meth_3_614)

	*615
split (meth_3_615), parse ("")
g meth_3_615_Lect=0 
g meth_3_615_QandA=0 
g meth_3_615_Quiz=0 
g meth_3_615_GroupWork=0 
g meth_3_615_Games=0 
g meth_3_615_Discussion=0 
g meth_3_615_ActOutClass=0 
g meth_3_615_ReadFromText=0 
g meth_3_615_PracticeEx=0 
g meth_3_615_Research=0 
g meth_3_615_Experiment=0 
g meth_3_615_Portfolio=0 

forval i=1/3{
destring meth_3_615`i',replace
replace meth_3_615_Lect=1 if meth_3_615`i'==1
replace meth_3_615_QandA=1 if meth_3_615`i'==2
replace meth_3_615_Quiz=1 if meth_3_615`i'==3
replace meth_3_615_GroupWork=1 if meth_3_615`i'==4
replace meth_3_615_Games=1 if meth_3_615`i'==5
replace meth_3_615_Discussion=1 if meth_3_615`i'==6
replace meth_3_615_ActOutClass=1 if meth_3_615`i'==7
replace meth_3_615_ReadFromText=1 if meth_3_615`i'==8
replace meth_3_615_PracticeEx=1 if meth_3_615`i'==9
replace meth_3_615_Research=1 if meth_3_615`i'==10
replace meth_3_615_Experiment=1 if meth_3_615`i'==11
replace meth_3_615_Portfolio=1 if meth_3_615`i'==12
}
foreach var in meth_3_615_Portfolio meth_3_615_PracticeEx meth_3_615_ActOutClass meth_3_615_Discussion meth_3_615_Experiment meth_3_615_Games meth_3_615_GroupWork meth_3_615_Lect meth_3_615_QandA meth_3_615_Quiz meth_3_615_ReadFromText meth_3_615_Research{
lab var `var' "615_Which three (3) teaching methods do you believe are least effective for teaching entrepreneurship subject?"
lab val `var' yesnolbl
}

forval i=1/3{
drop meth_3_615`i'
}

order meth_3_615_Lect meth_3_615_QandA meth_3_615_Quiz meth_3_615_GroupWork meth_3_615_Games meth_3_615_Discussion meth_3_615_ActOutClass meth_3_615_ReadFromText meth_3_615_PracticeEx meth_3_615_Research meth_3_615_Experiment meth_3_615_Portfolio, after (meth_3_615)

	*616
split (assess_616), parse ("")
g assess_616_Write=0 
g assess_616_Memorize=0 
g assess_616_Recall=0 
g assess_616_Remember=0 
g assess_616_Answer=0 
 
forval i=1/5{
destring assess_616`i',replace
replace assess_616_Write=1 if assess_616`i'==1
replace assess_616_Memorize=1 if assess_616`i'==2
replace assess_616_Recall=1 if assess_616`i'==3
replace assess_616_Remember=1 if assess_616`i'==4
replace assess_616_Answer=1 if assess_616`i'==5
}
foreach var in assess_616_Write assess_616_Memorize assess_616_Recall assess_616_Remember assess_616_Answer{
lab var `var' "616_How do you assess students on their skills and attitudes beyond just their knowledge?"
lab val `var' yesnolbl
}

forval i=1/5{
drop assess_616`i'
}

order assess_616_Write assess_616_Memorize assess_616_Recall assess_616_Remember assess_616_Answer, after (assess_616)

	*617
split (qual_impr_617), parse ("")
g qual_impr_617_BetterMat=0 
g qual_impr_617_MoreTrain=0 
g qual_impr_617_MoreSuppGov=0 
g qual_impr_617_MoreEffTeacher=0 
g qual_impr_617_MoreFdbk=0 

forval i=1/3{
*destring qual_impr_617`i',replace
replace qual_impr_617_BetterMat=1 if qual_impr_617`i'=="1"
replace qual_impr_617_MoreTrain=1 if qual_impr_617`i'=="2"
replace qual_impr_617_MoreSuppGov=1 if qual_impr_617`i'=="3"
replace qual_impr_617_MoreEffTeacher=1 if qual_impr_617`i'=="4"
replace qual_impr_617_MoreFdbk=1 if qual_impr_617`i'=="5"
}
foreach var in qual_impr_617_BetterMat qual_impr_617_MoreTrain qual_impr_617_MoreSuppGov qual_impr_617_MoreEffTeacher qual_impr_617_MoreFdbk{
destring `var',replace
lab var `var' "617_How can the quality of lessons at your school be improved?"
lab val `var' yesnolbl
}

forval i=1/3{
drop qual_impr_617`i'
}

order qual_impr_617_BetterMat qual_impr_617_MoreTrain qual_impr_617_MoreSuppGov qual_impr_617_MoreEffTeacher qual_impr_617_MoreFdbk, after (qual_impr_617)

	*618
split (chall_618), parse ("")
g chall_618_LowCapa=0 
g chall_618_NoMaterial=0 
g chall_618_LowQualMat=0 
g chall_618_TeachLackCont=0 
g chall_618_TeachLackPedag=0 
g chall_618_TeachLowMotiv=0 
g chall_618_TeachAbsen=0 
g chall_618_TeachEnglish=0 


forval i=1/7{
*destring chall_618`i',replace
replace chall_618_LowCapa=1 if chall_618`i'=="1"
replace chall_618_NoMaterial=1 if chall_618`i'=="2"
replace chall_618_LowQualMat=1 if chall_618`i'=="3"
replace chall_618_TeachLackCont=1 if chall_618`i'=="4"
replace chall_618_TeachLackPedag=1 if chall_618`i'=="5"
replace chall_618_TeachLowMotiv=1 if chall_618`i'=="6"
replace chall_618_TeachAbsen=1 if chall_618`i'=="7"
replace chall_618_TeachEnglish=1 if chall_618`i'=="8"
}
foreach var in chall_618_LowCapa chall_618_NoMaterial chall_618_LowQualMat chall_618_TeachLackCont chall_618_TeachLackPedag chall_618_TeachLowMotiv chall_618_TeachAbsen chall_618_TeachEnglish{
lab var `var' "618_What are the biggest challenges to having high quality lesson at your school?"
lab val `var' yesnolbl
}

forval i=1/7{
drop chall_618`i'
}

order chall_618_LowCapa chall_618_NoMaterial chall_618_LowQualMat chall_618_TeachLackCont chall_618_TeachLackPedag chall_618_TeachLowMotiv chall_618_TeachAbsen chall_618_TeachEnglish, after (chall_618)

	*619
split (mat_619), parse ("")
g mat_619_Syllab=0 
g mat_619_TeacherGuide=0 
g mat_619_LearnerGuide=0 
g mat_619_NotesOnSyllab=0 
g mat_619_LessPlans=0 
g mat_619_Nothing=0 

forval i=1/6{
*destring mat_619`i',replace
replace mat_619_Syllab=1 if mat_619`i'=="10"
replace mat_619_TeacherGuide=1 if mat_619`i'=="11"
replace mat_619_LearnerGuide=1 if mat_619`i'=="12"
replace mat_619_NotesOnSyllab=1 if mat_619`i'=="13"
replace mat_619_LessPlans=1 if mat_619`i'=="14"
replace mat_619_Nothing=1 if mat_619`i'=="15"
}
foreach var in mat_619_Syllab mat_619_TeacherGuide mat_619_LearnerGuide mat_619_NotesOnSyllab mat_619_LessPlans mat_619_Nothing{
lab var `var' "619_What materials do you have for the new Competence-based curriculum?"
lab val `var' yesnolbl
}

forval i=1/6{
drop mat_619`i'
}

order mat_619_Syllab mat_619_TeacherGuide mat_619_LearnerGuide mat_619_NotesOnSyllab mat_619_LessPlans mat_619_Nothing, after (mat_619)

    *620
replace teach_pres_620=. if teach_pres_620==-55
replace teach_620=2 if  teach_620==17
replace teach_pres_620=2 if teach_pres_620==16
replace teach_620=4 if  teach_620==7
replace teach_pres_620=4 if teach_pres_620==7
replace teach_pres_620=teach_620 if teach_620==3 & teach_pres_620==.

drop dup2 dup entry key submissiondate starttime endtime
 

 
	// Save with PIIS in encrypted location
cd "[directory]/HTeacher"

save HeadTeacher_Survey_cleaned, replace

// Save Without PIIs
cd "$clean_dir"	

		*Deidentification
qui ds name_*
foreach var in `r(varlist)'{
replace `var'="deidentified"
}			
local Piis first_name_200 family_name_200 
foreach v of local Piis{
replace `v'="deidentified"  
}


save HeadTeacher_Survey_cleaned_NOPII,replace
saveold HeadTeacher_Survey_cleaned_NOPIIv12, version(12) replace
export excel "HeadTeacher_Survey_cleaned_NOPIIv12.csv", replace
codebookout "Codebook_Master_HeadTeacher.xls",replace

